package com.xingda.packing.dmds.minitor.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xingda.packing.dmds.enums.BoxTaskType;
import lombok.Data;

import java.util.Date;

@Data
public class PkTaskDto {

    private Integer id;

    private String taskName;

    private String customerName;

    private String boxNo;

    private Integer state;

    private String wheelTypeName;

    private String specifications;

    private String surfaceLr;

    private Integer fixedLength;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    private Integer type;

    private String wheelTag;

    private Integer boxLocationId;

    public String getTypeName() {

        if (BoxTaskType.PACKING_FINISHED.getTypeId() == type) {
            return BoxTaskType.PACKING_FINISHED.getTypeName();
        } else if (BoxTaskType.PACKING_CLEAN.getTypeId() == type) {
            return BoxTaskType.PACKING_CLEAN.getTypeName();
        } else if (BoxTaskType.PACKING_SEMI_FINISHED_DISQUALITY.getTypeId() == type) {
            return BoxTaskType.PACKING_SEMI_FINISHED_DISQUALITY.getTypeName();
        }
        return "";
    }
}
